package org.szy.monitor.listener;

import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.event.EventListener;
import org.szy.core.common.entity.LoginUser;
import org.szy.monitor.service.UserOnlineService;
import org.szy.monitor.task.UserOnlineTask;

/**
 * 在线用户订阅事件
 *
 * @author 孙志阳
 * @date 2023-06-30
 * @since 1.0.0
 **/
@Component
public class UserOnlineEventListener implements EventListener<LoginUser> {

    @Inject
    private UserOnlineService userOnlineService;

    @Override
    public void onEvent(LoginUser event) {
        userOnlineService.online(event);
    }
}
